﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DangTinDoanhNghiep.aspx.cs" ValidateRequest="false" Inherits="WebHousingInfo.DangTinDoanhNghiep" %>
<%@ Register Src="~/Controls/Header.ascx" TagName="Head" TagPrefix="Header" %>
<%@ Register Src="~/Controls/MenuFooter.ascx" TagName="MeNuDuoi" TagPrefix="MenuFooter" %>
<%@ Register Src="~/Controls/Footer.ascx" TagName="Foot" TagPrefix="Footer" %>
<%@ Register Src="~/Controls/Quangcaotraitrangcon.ascx" TagName="QC" TagPrefix="Quangcaotraitrangcon" %>
<%@ Register Src="~/Controls/TimKiemTrangCon.ascx" TagName="TK" TagPrefix="TimKiemTrangCon" %>
<%@ Register Src="~/Controls/NhaDatBanThueMoiTrangCon.ascx" TagName="NDM" TagPrefix="NhaDatBanThueMoiTrangCon" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Đăng/Chỉnh sửa tin Doanh nghiệp</title>
</head>
<body>
    <form id="form1" runat="server">
        <div id="uni_wrapper">
            <Header:Head ID="Header" runat="server" />
	        <div id="uni_main">
	        <script type="text/javascript">
                function confirmAction() {
                    if(confirm('Hình trước đây sẽ bị xoá.\nBạn chắc chắn muốn thay đổi ?')) {
                        return true;
                    }
                    else {
                      
                        return false;
                    }
                }
                
                function confirmApprove() {
                    if(confirm('Bạn chắc chắn muốn kết thúc đăng tin ?')) {
                        return true;
                    }
                    else {
                      
                        return false;
                    }
                }
                
                function confirmDelete() {
                    if(confirm('Bạn chắc chắn muốn xóa tin này ?')) {
                        return true;
                    }
                    else {
                      
                        return false;
                    }
                }
            </script>
		        <div id="content" class="clearfix">
			        <div id="group_240_l">
			        <!--b box search-->
                        <TimKiemTrangCon:TK ID="TimKiemTrangCon" runat="server" />					     	
				        <NhaDatBanThueMoiTrangCon:NDM ID="NhaDatBanThueMoiTrangCon" runat="server" />
                        <Quangcaotraitrangcon:QC ID="Quangcaotraitrangcon" runat="server" />
			        </div>
			        <div id="group_710_r">
			            <% var objectBussiness = GetBussinessBO();%>
			            <div style="padding:5px;">
			                <a href="Home.aspx">Trang chủ nhà đất</a>&nbsp;>&nbsp;<% if (objectBussiness != null)
                                                                            { %><a href="#">Tin Doanh Nghiệp</a>&nbsp;>&nbsp;<a href="DangTinDoanhNghiep.aspx?iddn=<%=objectBussiness.NewsBussinessID %>"><%=objectBussiness.BussinessName%></a>
                                                                            <%}
                                                                            else
                                                                            { %><a href="DangTinDoanhNghiep.aspx">Đăng tin Doanh nghiệp mới</a><%} %>
                            <asp:Label ID="lblngaydang" Visible="false" runat="server" Text=""></asp:Label>
			            </div>
			            <asp:Panel ID="pn_result" Visible="false" runat="server">                
                            <div style="border:solid 1px coral; width:100%; text-align:center; height:30px; background:#FFFFCC; margin-bottom:10px;">                    
                                <asp:Label style="line-height:25px;" ID="lblthongbao" runat="server" Text="Thông Báo: Tin này đã hết hạn. Để tiếp tục đăng tin bạn vui lòng " ForeColor="Black" 
                                    Font-Bold="True"></asp:Label>                                
                                <asp:LinkButton ID="lbtgiahan" CausesValidation="false" runat="server" 
                                    Font-Bold="True" ForeColor="Blue" Font-Size="15px" onclick="lbtgiahan_Click">Gia Hạn Tin</asp:LinkButton>
                            </div>
                        </asp:Panel>    
				        <div id="contact-area">			
	                        <label class="contact_label">Tên Doanh nghiệp:</label>
                            <asp:TextBox ID="txtname" class="contact_content" MaxLength="100" runat="server"></asp:TextBox>    
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="txtname" ErrorMessage="?">*</asp:RequiredFieldValidator>
                            <div>
	                            <label class="contact_label">Hình đại diện:</label>
                                <asp:FileUpload ID="FileUpload_ImageBussiness" Visible="true" class="contact_content" Height="22px" Width="265px" runat="server" />
                                <asp:TextBox ID="txtimage" ReadOnly="true" class="contact_content" Width="300px" Visible="false" style="margin-right:2px;" runat="server"></asp:TextBox>                                    
                                <asp:LinkButton ID="lbtchangeimage" CausesValidation="false" Visible="false" OnClientClick="javascript:return confirmAction();" 
                                    runat="server" onclick="lbtchangeimage_Click">Thay đổi hình</asp:LinkButton>
                            </div>            		
	                        <label class="contact_label">Địa chỉ:</label>
	                        <asp:TextBox ID="txtaddress" class="contact_content" MaxLength="200" runat="server"></asp:TextBox> 
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtaddress" ErrorMessage="?">*</asp:RequiredFieldValidator>
	                        <label class="contact_label">Website:</label><br>
	                        <asp:TextBox ID="txtwebsite" class="contact_content" MaxLength="100" runat="server"></asp:TextBox>                		
	                        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtwebsite" ErrorMessage="?">*</asp:RequiredFieldValidator>
	                        <div>
	                            <label class="contact_label">Điện thoại:</label>
	                            <asp:TextBox ID="txtphone" MaxLength="50" class="contact_content" runat="server"></asp:TextBox>  
	                            <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="txtphone" ErrorMessage="?">*</asp:RequiredFieldValidator>              		
	                            <asp:RegularExpressionValidator ID="RegularExpressionValidator5" runat="server" 
                                    ControlToValidate="txtphone" ErrorMessage="Định dạng không đúng" 
                                    ValidationExpression="^[\d]+\.?[\d]+$"></asp:RegularExpressionValidator>
                            </div>
                            <div>
	                            <label class="contact_label">Email:</label>
	                            <asp:TextBox ID="txtemail" MaxLength="100" class="contact_content" runat="server"></asp:TextBox>  
	                            <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="txtemail" ErrorMessage="?">*</asp:RequiredFieldValidator>
	                            <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server"
                                    ErrorMessage="Email không hợp lệ" ControlToValidate="txtemail" 
                                    ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator>              		
                            </div>
	                        <label class="contact_label">Thời gian đăng:</label>
	                        <asp:DropDownList ID="dltimepost" class="contactdroptime"  runat="server">
                                <asp:ListItem Value="5">5 Ngày</asp:ListItem>
                                <asp:ListItem Value="10">10 Ngày</asp:ListItem>
                                <asp:ListItem Value="30">1 Tháng</asp:ListItem>
                            </asp:DropDownList>
	                        <label class="contact_label">Mô tả:</label>
	                        <asp:TextBox ID="txtcontent" class="contact_content" Height="100px" TextMode="MultiLine" runat="server"></asp:TextBox>                		
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ControlToValidate="txtcontent" ErrorMessage="?">*</asp:RequiredFieldValidator>
                            <asp:Panel ID="pn_giahan" Visible="false" runat="server">
	                        <div>	                            
	                            <label class="contact_label">Số lần đã gia hạn:</label>
                                <asp:Label ID="lblsolan" style="line-height:25px;" runat="server" Text="0"></asp:Label>                                
	                        </div>
	                        <div>
	                            <label class="contact_label">Thời gian gia hạn:</label>
	                            <asp:DropDownList ID="dltimeex" class="contactdroptime" runat="server">
                                    <asp:ListItem Value="5">5 Ngày</asp:ListItem>
                                    <asp:ListItem Value="10">10 Ngày</asp:ListItem>
                                    <asp:ListItem Value="30">1 Tháng</asp:ListItem>
                                </asp:DropDownList>
	                        </div>
	                        </asp:Panel>
	                        <div align="right" style="padding-right:142px;">	                            
						        <asp:Button ID="btndangtin" runat="server" class="sumitbussiness" 
                                    Text="Đăng Tin" onclick="btndangtin_Click"/>
                                <asp:Button ID="btnketthuc" Visible="false" Width="120px" 
                                    OnClientClick="javascript:return confirmApprove();" runat="server" 
                                    CausesValidation="false" class="cancelbussiness" Text="Kết thúc đăng tin" 
                                    onclick="btnketthuc_Click" />
                                <asp:Button ID="btnxoa" Visible="false" 
                                    OnClientClick="javascript:return confirmDelete();" runat="server" 
                                    CausesValidation="false" class="cancelbussiness" Text="Xóa" 
                                    onclick="btnxoa_Click" />
						        <asp:Button ID="btnhuy" runat="server" CausesValidation="false" class="cancelbussiness" Text="Huỷ" 
                                    onclick="btnhuy_Click"/>                                
                            </div>                        	
                        </div>    
				        
				        
			        </div>
		        </div>  	
		        <MenuFooter:MeNuDuoi ID="MenuFooter" runat="server" />	
	        </div>
	        <Footer:Foot ID="Footer" runat="server" />
        </div>    
    </form>
</body>
</html>
